// 创建数组实例

// new Array( length )
let a = new Array( 5 );
console.log( a );
console.log( a.length );
console.log( Object.hasOwn( a, 'length' ) ); // true

// new Array( ...elements )
let b = new Array( 1, 2, 3, 4, 5 );
console.log( b );
console.log( b.length );
console.log( Object.hasOwn( b, 'length' ) ); // true

let c = new Array( 1 , 2, 'afang', true, Symbol('suibian') , { name: '德芳' });
console.log( c );
console.log( c.length );
console.log( Object.hasOwn( c, 'length' ) ); // true

let d = new Array();
console.log( d );
console.log( d.length );

console.log( '- '.repeat( 20 ) );

// 用 数组字面量 创建数组实例
let e = [ '宋江', '诸葛亮', '孙悟空', '李小芳' ];
console.log( e );
console.log( e.length );

// 参考文档
// https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/Array